package com.cloudsigns.factorymanager2.engineering.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.cloudsigns.factorymanager2.R;
import com.cloudsigns.factorymanager2.engineering.activity.CompletionOrderListForSuperActivity;
import com.cloudsigns.factorymanager2.engineering.activity.CreateEngineeringOrderListActivity;
import com.cloudsigns.factorymanager2.engineering.activity.RegionListActivity;

/**
 * 工程 工单管理 超级管理员
 * Created by tony on 2018/1/13.
 */

public class EngineeringOrderManagementForSuperFragment extends Fragment implements View.OnClickListener {
    private LinearLayout ll_work_sheets, ll_media, ll_completion_or_success;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_engineering_order_management_super, null);
        ll_work_sheets = view.findViewById(R.id.ll_work_sheets);
        ll_media = view.findViewById(R.id.ll_media);
        ll_completion_or_success = view.findViewById(R.id.ll_completion_or_success);


        ll_work_sheets.setOnClickListener(this);
        ll_media.setOnClickListener(this);
        ll_completion_or_success.setOnClickListener(this);

        return view;
    }

    @Override
    public void onClick(View view) {
        Intent mIntent;
        switch (view.getId()) {
            case R.id.ll_work_sheets:
                mIntent = new Intent(getActivity(), CreateEngineeringOrderListActivity.class);
                startActivity(mIntent);
                break;
            case R.id.ll_media:
                mIntent = new Intent(getActivity(), RegionListActivity.class);
                startActivity(mIntent);
                break;
            case R.id.ll_completion_or_success: //竣工完结
                mIntent = new Intent(getActivity(), CompletionOrderListForSuperActivity.class);
                startActivity(mIntent);
                break;
//            case R.id.rl_create_order:  //新建工单
//                mIntent = new Intent(getActivity(), CreateEngineeringOrderListActivity.class);
//                startActivity(mIntent);
//                break;
//            case R.id.rl_receive_order:  //接收工单
//                mIntent = new Intent(getActivity(), ReceiveEngineeringOrderListActivity.class);
//                startActivity(mIntent);
//                break;
//            case R.id.rl_edit_order:
//                mIntent = new Intent(getActivity(), EditEngineeringOrderListActivity.class);
//                startActivity(mIntent);
//                break;
//            case R.id.rl_assigned_order:
//                mIntent = new Intent(getActivity(), DispatchEngineeringOrderListActivity.class);
//                startActivity(mIntent);
//                break;
//            case R.id.rl_4:
//                mIntent = new Intent(getActivity(), MaintenanceOrderListActivity.class);
//                startActivity(mIntent);
//                break;
        }
    }
}
